package BasicGrammar.Basic;

public class day_0917 {
//    public static void main1(String[] args) {
//        int a = 10;
//        if (a == 19) {
//            System.out.println(a);
//        } else {
//            System.out.println("00");
//        }
//    }
//
//    public static void main2(String[] args) {
//        int a = 1;
//        int sum = 0;
//        while (a <= 100) {
//            sum += a;
//            a++;
//            System.out.println(sum);
//        }
//    }

//else 与最近的if联

//long boolean float double 不可以做switch类型的选择

//for 与 do while（次数不确定）

//continue与break是急刹的意思

public static void main3(String[] args) {
    int a = 1;
    while (a <= 100){
        if (a % 12 != 0){
            a++;
            continue;
        }
        a++;
        System.out.print(a+" " );
    }
}

    public static void main(String[] args) {
        for (int i = 1; i <= 999999; i++) {
            int tem = i;
            int count = 0;
            while (tem != 0) {
                tem /= 10;
                count += 1;
            }
            int a = 0;
            int sum = 0;
            tem = i;
            while (tem != 0) {
                a = tem % 10;
                sum += Math.pow(a , count);
                tem = tem / 10;
            }

            if (sum == i) {
                System.out.println(i +"是素数");
            }
            }
        }
    }
